import {view, ViewGroup, binder} from "adajs";
import TabService from "./state.js";

@view({
	className: "tab",
	template: "./template.html",
	style: "./style.scss",
	dataset: {
		service: TabService
	}
})
class Tab extends ViewGroup {
	@binder("activeTab")
	activeTab({tab}) {
		this.commit('activeTab', tab);
		this.dispatchEvent("activeTab", tab.name);
	}
}

export default Tab;